package com.example.everying.model.entity.invite;/*
 * 项目名称: everything
 * 文件名: InviteCode
 * 作者: 张泽阳
 * 日期: 2025/5/26
 * 描述:
 */


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "invite_code")
public class InviteCodeEntity {
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "邀请码主键ID")
    private String id;

    @NotNull(message = "邀请码不能为空")
    @ApiModelProperty(value = "邀请码")
    private String inviteCode;

    @NotNull(message = "邀请码所属用户id不能为空")
    @ApiModelProperty(value = "邀请码所属用户id")
    private String ownerId;

    @ApiModelProperty(value = "邀请码使用次数")
    private Integer useCount;

    @ApiModelProperty(value = "邀请码状态：1：正常；2：禁用")
    private Integer status;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime  createTime;
}
